package com.mali.malibackendproduct.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mali.malibackendmodel.pojo.Server;
import com.mali.malibackendproduct.service.ServerService;
import com.mali.malibackendproduct.mapper.ServerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author 132993
* @description 针对表【server(服务表)】的数据库操作Service实现
* @createDate 2024-06-18 16:21:55
*/
@Service
public class ServerServiceImpl extends ServiceImpl<ServerMapper, Server>
    implements ServerService{

    @Autowired
    private ServerMapper serverMapper;

    @Override
    public Long getIdByProductId(Long productId) {
        QueryWrapper<Server> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("product_id", productId);
        return serverMapper.selectOne(queryWrapper).getId();
    }
}




